package com.gusto.engine.semsim.service;

import com.gusto.engine.beans.model.Res;
import com.gusto.engine.semsim.exceptions.ConfigException;
import com.gusto.engine.semsim.exceptions.SimilarityException;

/**
 * <p>Interface for calculating similarities between objects.</p>
 * 
 * @author amokrane.belloui@gmail.com
 *
 */
public interface SimilarityService {
	
	/**
	 * Checking if the definition has changed
	 * @throws ConfigException
	 */
	public void checkDefinitionChanged() throws ConfigException;
	
	/**
	 * The context is changed, to be overridden
	 */
	public void contextConfigChanged(String context);
	
	/**
	 * Getting the similarity between 2 resources in a particular context, <br/>
	 * Each context corresponds to a certain situation,
	 * for example user similarity, item similarity, category similarity, etc.
	 * @param context
	 * @param resource1
	 * @param resource2
	 * @return
	 * @throws SimilarityException
	 */
	public Double getSimilarity(String context, Res resource1, Res resource2) throws SimilarityException;
	
}
